{% extends "base.html" %}
{% block title %}  {% endblock %}
{% block head %}
	{{ parent() }}
{% endblock %}


{%block css%}
		<link rel="stylesheet" href="{{base_url}}/views/css/style.css">
		<link rel="stylesheet" href="{{base_url}}/views/css/navbar/navbar.css">
		<link rel="stylesheet" href="{{base_url}}/views/css/navbar/navbar_2.css">
{%endblock%}


{%block header %}	
		<header> 
			<div class="header">

					<div class="head">
					<div class="logo_main">
						<img src="views/img/logo_main.png" alt="">
					</div>
					<div class="head-right">
						{{ render('/authcontrol') }}	
						<div class="search">
							<div>
								<input type="text"><button class="button-blue">  >> </button>
							</div>
						</div>
					</div>
				</div>


				<div class="navbar">
				  <div class="navbar-inner">
				    <ul class="nav">
				      <li class="" ><a href="{{base_url}}">ГЛАВНАЯ</a></li>
				      <li class="divider-vertical"></li>
				      <li class="{{names_active.aboutproject}}" ><a href="{{base_url}}aboutproject">О ПРОЕКТЕ</a></li>
				      <li class="divider-vertical"></li>
				      <li class="{{names_active.garant}}" ><a href="{{base_url}}garant">ГАРАНТИИ</a></li>
				      <li class="divider-vertical"></li>
				      <li class="{{names_active.contacts}}" ><a href="{{base_url}}contacts">КОНТАКТЫ</a></li>
				      <li class="divider-vertical"></li>
				      <li class="{{names_active.about}}" ><a href="{{base_url}}about">О НАС</a></li>
				    </ul>
				  </div>
				</div>
			</div>
		</header>



{% endblock%}

	

{% block content %}
	
	<style>
		.editbar{
			float:right;
		}

		footer {
			margin-top:0;
		}

		.edit-content{
			/*max-width: 60%	*/
		}
		.content{
			width:1040px;
			margin-right: auto;
			margin-left: auto;
		}

	</style>	
	
	<div class="content">
		<div class="edit-content" >
		{% if text_url == "/project" %}
			{{render('/texts/project')}}
		{% endif %}	
		{% if text_url == "/garant" %}
			{{render('/texts/garant')}}
		{% endif %}	
		{% if text_url == "/contacts" %}
			{{render('/texts/contacts')}}
		{% endif %}	
		{% if text_url == "/aboutproject" %}
			{{render('/texts/aboutproject')}}
		{% endif %}	
		{% if text_url == "/about" %}
			{{render('/texts/about')}}
		{% endif %}	
		
		</div>	
		{% if user_var.role < 3 %}
				<style>
					.static-page{
						margin:150px;
						margin-left:0;
						margin-right: 0;
					}
					
					.edit-content{
						float:left;
					}

					.editbar{
						max-width: 320px;
						float:right;
					}

					.galery {
						width:270px;
						margin-left:auto;
						margin-right: auto;
	
					}
					.galery-pics {
						max-width: 250px ;
						margin-left:auto;
						margin-right:auto;
						padding:5px;
						border:1px solid grey;
					}
					.clear-fix {
						clear:both;
					}
				</style>	
				<div class="editbar">
					<button data-bind="click:views.editor.enable">Edit</button>
					<button data-bind="click:views.editor.disable">Cancel</button>
					<button data-bind="click:views.editor.save">Save</button>

					<form enctype="multipart/form-data" action="{{base_url}}upload/" method="post">
						<input type="hidden" name="MAX_FILE_SIZE" value="3000000">
						<input type="hidden" name="route" value="{{base_url}}{{text_url}}">
						Добавить файл в галлерею : <input name="userfile" type="file">
						<input type="submit" value="Send File">
					</form>

					<input type="text" data-bind="value:filename, click:views.pics.select">
					
					<div class="galery" data-bind="foreach:views.pics.pics">
						<img class="galery-pics" alt="" data-bind="attr:{src:src}, click:click"><br>
					</div>	
				</div>
				<div class="clear-fix"></div>
		</div>			
				
	
				<script>
					window.views = window.views || {};	
					window.views.pics = window.views.pics || {};	
						
					window.views.pics.base_url = {{base_url}}
					var PicsData  = {{pics_data | raw}};

				</script>
		
				
				<script>
					window.views = window.views || {};	
					window.views.editor = window.views.editor || {};	
					window.views.editor.base_url = "{{base_url}}";
					window.views.editor.url = "{{text_url}}" ;
					
					window.views.pics = window.views.pics || {};	
					window.views.pics.base_url = {{base_url}}
					var PicsData  = {{pics_data | raw }}
				</script>
				<script src="views/js/editor.js"></script>
				<script src="views/js/pics.js"></script>
		{% endif %}

	
{% endblock %}




{% block footer %}

		<footer>
			<div class="footer">
				<div class='paysystem'>
					<table>
						<tr>
							<td><img src="views/img/paysystem_icon_11.png" alt=""></td>
							<td><img src="views/img/paysystem_icon_12.png" alt=""></td>
							<td><img src="views/img/paysystem_icon_13.png" alt=""></td>
						</tr>
						<tr>
							<td><img src="views/img/paysystem_icon_21.png" alt=""></td>
							<td><img src="views/img/paysystem_icon_22.png" alt=""></td>
							<td><img src="views/img/paysystem_icon_23.png" alt=""></td>
						</tr>
						<tr>
							<td><img src="views/img/paysystem_icon_31.png" alt=""></td>
							<td><img src="views/img/paysystem_icon_32.png" alt=""></td>
							<td><img src="views/img/paysystem_icon_33.png" alt=""></td>
						</tr>
					</table>
				</div>




				<div class="bottom-menu">
					<table>
						<tr>
							<td>
								<ul>
									<li>Главная</li>
									<li>Новости</li>
									<li>О проекте</li>
									<li>Контакты</li>
								</ul>
							</td>
							<td>
								<ul>
									<li>О нас</li>
									<li>Блог</li>
									<li>Проекты</li>
									<li>Наша сеть</li>
								</ul>
							</td>
						</tr>
					</table>
				</div>
				<div class="socnet">
					Мы в сети <br>
					<img src="views/img/net_icon_1.png" alt="">	
					<img src="views/img/net_icon_2.png" alt="">	
					<img src="views/img/net_icon_3.png" alt="">	
					<img src="views/img/net_icon_4.png" alt="">	
					<img src="views/img/net_icon_5.png" alt="">	
					<img src="views/img/net_icon_6.png" alt="">	
				</div>
			</div>	
			
		</footer>



{% endblock %}





{% block scripts %}
	
	<script src="views/lib/tinymce/tinymce.min.js"></script>
	<script src="views/js/auth.js"></script>
	<script src="views/js/static.js"></script>
	
{% endblock %}
